Merged
Conversation
58885f2 to
bfb710d
Compare
Contributor
Author
|
@ryantm I edited the description to explain the odd testing story here |
ryantm
approved these changes
Sep 30, 2024
This has given enough confidence to move forward with the TypedDict inputs, though we still need a good story for structurally parsing and validating.
Yet more confidence that we are testing what we think we are
c319d0b to
9fefb77
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
We got pretty close to having TypedDicts for river-python inputs before, but had to roll back due to a protocol mismatch.
Trying again, and also adding some tests to confirm that at the very least the Pydantic models can decode was was encoded by the TypedDict encoders. It's not a perfect science, but it should be good enough to start building more confidence as we make additional progress.
The reason for "janky" tests
There's a bit of a chicken-and-egg situation when trying to test code generation at runtime.
We have three options:
gen1,gen2,gen3, one for each codegen run necessary) and carefully juggle the imports to make sure we don't try to import something that's not there yet. This might be the best option, but I'm not convinced about the ergonomics at the moment. It might be OK though, with highly targeted.gitignore's.I definitely wrote the tests here in a way that would give some coverage and also provide confidence, while intentionally deferring the above decision so we can keep making progress. in the meantime.
What changed
Test plan